package com.zx.idc.backend.gui.tlog;


import com.baomidou.mybatisplus.plugins.Page;
import com.zx.idc.backend.gui.common.BaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.tlog.service.ITLogOperationService;
import com.zx.idc.ds.tlog.vo.TLogOperationVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 操作日志 前端控制器
 * </p>
 *
 * @author 陈冬
 * @since 2019-04-09
 */
@RestController
@RequestMapping("/api/tlogOperation")
public class TlogOperationController extends BaseApi {
    @Autowired
    private ITLogOperationService service;

    @GetMapping("/query-page")
    @RequiresPermissions("transaction-log:t-log-operation")
    public Result<Page<TLogOperationVo>> page(Page<TLogOperationVo> page, TLogOperationVo tlogOperationVo) {
        return success(service.pageByParam(page, tlogOperationVo));
    }

    /**
     * 根据ID获取记录
     */
    @GetMapping("/get/{id}")
    @RequiresPermissions("transaction-log:t-log-operation")
    public Result<TLogOperationVo> get(@PathVariable("id") Integer id) {
        return success(service.get(id));
    }
}

